package thread;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

public class Reallythread {
    public static void main(String[] args) {
        Thread thread =new Thread();
        thread.start();
        //通过Runnable接口
        Thread thread1=new Thread(new Runnable() {
            @Override
            public void run() {

            }
        });
        thread1.start();
        //第三种，通过callable接口
        new FutureTask<String>(new Callable<String>() {
            @Override
            public String call() throws Exception {
                return null;
            }
        });
        ExecutorService executorService = Executors.newFixedThreadPool(1);
        executorService.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        });
        executorService.shutdown();
    }

}
